package com.java8.ch06;

/**
 * This program declares two Box objects.
 * 
 * @author Administrator
 *
 */
class BoxTwo {

	double width;
	double height;
	double depth;
}

class BoxDemo2 {

	public static void main(String[] args) {
		BoxTwo mybox1 = new BoxTwo();
		double vol;
		// assign values to mybox1's instance variable
		mybox1.width = 3;
		mybox1.height = 6;
		mybox1.depth = 9;

		// compute volume of mybox1
		vol = mybox1.width * mybox1.height * mybox1.depth;
		System.out.println("Volumn is " + vol);

		BoxTwo mybox2 = new BoxTwo();
		// assign values to mybox2's instance variable
		mybox2.width = 10;
		mybox2.height = 20;
		mybox2.depth = 15;

		// compute volume of mybox2
		vol = mybox2.width * mybox2.height * mybox2.depth;
		System.out.println("Volumn is " + vol);
	}
}
